namespace 公积金贷款额度计算
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        /// <summary>
        /// 计算
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            decimal total = Convert.ToDecimal(textBox1.Text);
            decimal monthUp = Convert.ToDecimal(textBox2.Text);
            //计算近12个月的总金额
            decimal total12 = 0;
            for (int i = 1; i < 13; i++)
            {
                decimal temp = total;
                total12+=(temp-monthUp);
                temp = temp-monthUp;
            }

            textBox3.Text = total12.ToString();
            textBox4.Text = (total12/12*15).ToString();
        }
    }
}